home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / comm1 / amybw214.lha / AmyBW / Rot13.rexx < prev    next >
OS/2 REXX Batch file  |  1994-11-03  |  1KB  |  46 lines

  1. /**********************************************
  2.  ** Rot13 a message  *  Sample arexx script  **
  3.  **********************************************
  4.  **                                          **
  5.  ** Set up the user command like this:       **
  6.  ** +--------------------------------------+ **
  7.  ** |         Command: RX AmyBW:Rot13.rexx | **
  8.  ** |        Filename: T:AmyBW.temp        | ** 
  9.  ** |  Write msg text: Y                   | **
  10.  ** |   Incude header: N                   | **
  11.  ** | Reload msg text: Y                   | **
  12.  ** +--------------------------------------+ **
  13.  **********************************************/
  14.  
  15.     /***
  16.      *** Open input and output file
  17.      ***/
  18.  
  19. call open(in,"T:AmyBW.temp",read)
  20. call open(out,"T:AmyBW.rot",write)
  21.  
  22.     /***
  23.      *** Translate the lines
  24.      ***/
  25.  
  26. do while ~EOF(in)
  27.  inline = readln(in)
  28.  outline = TRANSLATE(inline,'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM','abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
  29.  call writeln(out, outline)
  30. end
  31.  
  32.     /***
  33.      *** Close the files
  34.      ***/
  35.  
  36. call close(in)
  37. call close(out)
  38.  
  39.     /***
  40.      *** Delete original, rename new file
  41.      ***/
  42.  
  43. address command 'Delete >NIL: T:AmyBW.temp'
  44. address command 'Rename >NIL: T:AmyBW.rot T:AmyBW.temp'
  45.  
  46.